package com.cxyd.modules.wcs.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cxyd.common.service.impl.CrudServiceImpl;
import com.cxyd.modules.wcs.dao.TcpResponseDao;
import com.cxyd.modules.wcs.dto.TcpResponseDTO;
import com.cxyd.modules.wcs.entity.TcpResponseEntity;
import com.cxyd.modules.wcs.service.TcpResponseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

@Slf4j
@Service
public class TcpResponseServiceImpl extends CrudServiceImpl<TcpResponseDao, TcpResponseEntity, TcpResponseDTO> implements TcpResponseService {
    @Override
    public QueryWrapper<TcpResponseEntity> getWrapper(Map<String, Object> params) {
        return null;
    }

    @Override
    public TcpResponseEntity getMappingByNoticeType(String noticeType, String taskTyp) {
        QueryWrapper<TcpResponseEntity> wrapper = new QueryWrapper<>();
        wrapper.eq("notice_type", noticeType)
                .eq("task_typ", taskTyp).last("LIMIT 1");
        return baseDao.selectOne(wrapper);
    }
}

